package com.twu.biblioteca;

public class ShowAllBooksAction implements Action {
    private Library library;

    public ShowAllBooksAction(Library library) {
        this.library = library;
    }

    public String execute() {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("\nThe books list is as follow:\n");
        for (Book book : library.getBooks()) {
            stringBuffer.append(book.toString() + "\n");
        }
        return stringBuffer.toString();
    }
}
